Skip to content

ASoC: SOF: ipc4-topology: Allow the use of multiple formats for src output#5694

Merged
ujfalusi merged 1 commit intothesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/src_multiple_out
Mar 27, 2026
Merged

ASoC: SOF: ipc4-topology: Allow the use of multiple formats for src output#5694
ujfalusi merged 1 commit intothesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/src_multiple_out

Conversation

@ujfalusi
Copy link
Copy Markdown
Collaborator

…utput

The SRC module can only change the rate, it keeps the format and channels intact, but this does not mean the the num_output_formats must be 0: The SRC module can support different formats/channels, we just need to check if the output format lists the correct combination of out rate and the input format/channels.

Change the logic to prioritize the sink_rate of the module as target rate, then the rate of the FE in case of capture or in case of playback check the single rate specified in the output formats.

@ujfalusi ujfalusi requested a review from singalsu March 13, 2026 07:32
@ujfalusi ujfalusi changed the title ASoC: SOF: ipc4-topology: format print update and allow the use of multiple formats for src output ASoC: SOF: ipc4-topology: Allow the use of multiple formats for src output Mar 13, 2026
sof_ipc4_update_resource_usage(sdev, swidget, &src->data.base_config);

out_audio_fmt = &available_fmt->output_pin_fmts[output_fmt_index].audio_fmt;
src->data.sink_rate = out_audio_fmt->sampling_frequency;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bogus change.

@ujfalusi ujfalusi force-pushed the peter/sof/pr/src_multiple_out branch from 9f533aa to a8e7689 Compare March 13, 2026 10:23
…utput

The SRC module can only change the rate, it keeps the format and channels
intact, but this does not mean the the num_output_formats must be 0:
The SRC module can support different formats/channels, we just need to
check if the output format lists the correct combination of out rate and
the input format/channels.

Change the logic to prioritize the sink_rate of the module as target rate,
then the rate of the FE in case of capture or in case of playback check the
single rate specified in the output formats.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Copy link
Copy Markdown
Collaborator

@singalsu singalsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked, I just successfully tested with compress playback random format sine wav files and all rates/channels/formats combinations worked. Thanks Peter!

Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good (once I understood what "sink_rate" was)

out_ref_rate = params_rate(fe_params);
if (src->data.sink_rate) {
/* Use the sink rate as reference */
out_ref_rate = src->data.sink_rate;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, this is a bit confusing to understand as the variable is "sink_rate" but the topology name is "rate_out". But not related to this PR, but right, so priority is given to the rate defined in topology (rate_out token).

@ujfalusi ujfalusi merged commit d4b2952 into thesofproject:topic/sof-dev Mar 27, 2026
10 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants